package com.czkevin.changecraft;

import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.Recipe;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.plugin.java.JavaPlugin;

public class TestPlugin extends JavaPlugin {
    
    @Override
    public void onEnable() {
        // register custom recipe
        ItemStack diamondPickaxe = new ItemStack(Material.DIAMOND_PICKAXE, 1);
        diamondPickaxe.addUnsafeEnchantment(Enchantment.DIG_SPEED, 100);
        
        ShapedRecipe customRecipe = new ShapedRecipe(new NamespacedKey(this, "diamond_pickaxe"), diamondPickaxe);
        customRecipe.shape("zxz", "zxz", "yyy");
        customRecipe.setIngredient('x', Material.STICK);
        customRecipe.setIngredient('y', Material.DIAMOND_BLOCK);
        customRecipe.setIngredient('z', Material.AIR);
        this.getServer().addRecipe(customRecipe);
    }
}
